package com.mathlearning.auth.repository;

import com.mathlearning.auth.entity.UserProgress;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface UserProgressRepository extends JpaRepository<UserProgress, Long> {
    
    /**
     * 查询用户某课程的进度
     */
    Optional<UserProgress> findByUserIdAndCourseId(Long userId, Long courseId);
    
    /**
     * 查询用户所有课程的进度
     */
    List<UserProgress> findByUserId(Long userId);
}








